unit Fortschr;

interface

uses
  Windows, Messages, SysUtils, Classes,
  {$IFDEF MSWINDOWS}
  Graphics, Controls, Forms,
  {$ELSE}
  QGraphics, QControls, QForms,
  {$ENDIF}
  Dialogs,
  StdCtrls, ComCtrls, Buttons, Winsock, IdFtp;

type
  TFortschritt = class(TForm)
    ProgressBar1: TProgressBar;
    Label1: TLabel;
    Memo1: TMemo;
    ESC: TBitBtn;
    OK: TBitBtn;
    Label2: TLabel;
    Label3: TLabel;
    procedure ESCClick(Sender: TObject);
    procedure OKClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Fortschritt: TFortschritt;

implementation

Uses FtpThread, HttpThread, Sdimain;

{$R *.DFM}

procedure TFortschritt.ESCClick(Sender: TObject);
begin
  If SDIAppForm.FTPLaeuft then
  Begin
    MyFtpThread.Terminate;
    If MyFtpThread.WaitFor >= 0 then
    Begin
      MyFtpThread.Free;
      SDIAppForm.FTPLaeuft := False;
    End;
  End;
  If SDIAppForm.HTTPLaeuft then
  Begin
    MyHttpThread.Terminate;
    If MyHttpThread.WaitFor >= 0 then
    Begin
      MyHttpThread.Free;
      SDIAppForm.HTTPLaeuft := False;
    End;
  End;
  Hide;
  SDIAppForm.Update_Grid(True);
end;

procedure TFortschritt.OKClick(Sender: TObject);
begin
  If SDIAppForm.FTPLaeuft then
  Begin
    MyFtpThread.Free;
    SDIAppForm.FTPLaeuft := False;
  End;
  If SDIAppForm.HTTPLaeuft then
  Begin
    MyHttpThread.Free;
    SDIAppForm.HTTPLaeuft := False;
  End;
  Hide;
  SDIAppForm.Update_Grid(True);
end;

end.
